<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>基本使用</title>
    <style>
      body {
        direction: rtl;
      }

      .flex-container {
        display: -webkit-flex;
        display: flex;
        width: auto;
        height: 150px;
        background-color: lightgrey;
      }

      .flex-item {
        background-color: cornflowerblue;
        width: 100px;
        height: 100px;
        line-height: 100px;
        margin: 10px;
        text-align: center;
      }
    </style>
  </head>

  <body>
    <h1>
      如果我们设置页面排列方式 direction 属性为 rtl
      (right-to-left)，弹性子元素的排列方式也会改变，页面布局也跟着改变：
    </h1>
    <div class="flex-container">
      <div class="flex-item">flex item 1</div>
      <div class="flex-item">flex item 2</div>
      <div class="flex-item">flex item 3</div>
    </div>
  </body>
</html>
